﻿using System;
using System.Collections;
using com.fukefu.sql;

namespace com.fukefu.tools
{
    public class Preferences
    {
        Hashtable ht = new Hashtable();

        public Preferences()
        {
            SqlServerOperate sql = new SqlServerOperate();
            System.Data.SqlClient.SqlDataReader re = sql.Query("select k,v from [全局设置].dbo.[首选项]");
            while (re.Read())
            {
                ht.Add(re["k"].ToString(), re["v"].ToString());
            }
            sql.Close();
        }
        public string GetString(string key)
        {
            return ht[key].ToString();
        }
        public int GetInt(string key)
        {
            return Convert.ToInt32(ht[key]);
        }
    }
}
